UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nbos+kSojD4FY0VBCk3L/UMPZfwKrWev3IOfwZCtbIs='
WHERE
key_id = '6f8dc7806b1ffef9a5e529c5cbf30f5acd4a90400974044d1e49cf442d31681b'
AND (
token = 'nbos+kSojD4FY0VBCk3L/UMPZfwKrWev3IOfwZCtbIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)