UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/1iKcqfrhyZD0pflXH+I8KM3R5vz4UfnGsa+jr5D6+g='
WHERE
key_id = 'f2e868a8143b29d73e553238fe4dc6f28eef39983993815835384a6991702b6c'
AND (
token = '/1iKcqfrhyZD0pflXH+I8KM3R5vz4UfnGsa+jr5D6+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)