UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j8P7aIwDCtH6EV4FGi6/cI/Io6JC77z6b8ZyNnN4DLE='
WHERE
key_id = 'bb19bb871c2d0e92aa2675522a50cd313865ec9273492947dbd20c67507b3840'
AND (
token = 'j8P7aIwDCtH6EV4FGi6/cI/Io6JC77z6b8ZyNnN4DLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)