UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YpR9YIWWKPE+QDxrgLB0ahFYk0NCyDFaPHCaLbp4ZkY='
WHERE
key_id = '4c477c76f8e35a11fd99b2908a3b001cab60e5075e46101bdd59e4f11dbe2e8e'
AND (
token = 'YpR9YIWWKPE+QDxrgLB0ahFYk0NCyDFaPHCaLbp4ZkY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)