UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/TY4p7g5IJkHCY/cxrs72vpDTD5c30ko7N3gY6bQ8qE='
WHERE
key_id = '6eca1cedbc5047e16227077d31b24fcb1648661bb0abb7916ad2ed989552c264'
AND (
token = '/TY4p7g5IJkHCY/cxrs72vpDTD5c30ko7N3gY6bQ8qE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)