UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6C4s87y/7RbvNC/It/l3DmryR271YYNX56lJw9Qo0LU='
WHERE
key_id = 'f97f2bc539d597cb33dba89a49136c89ff2385bc8fb6e3adef7e441c8e4905b7'
AND (
token = '6C4s87y/7RbvNC/It/l3DmryR271YYNX56lJw9Qo0LU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)