UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9GeXxXS/BNm7n4U/ArH8fXkbU5AEoPpb0esirNmFR5w='
WHERE
key_id = '679b2e94dc3dbf20363b5af6bae0332ebbb4f3de4124bdfd98f2a66c35865855'
AND (
token = '9GeXxXS/BNm7n4U/ArH8fXkbU5AEoPpb0esirNmFR5w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)