UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6YyY0+ZPzKxnW+iDi+C9a67o4J9rhBpq+yCRVMIEFIk='
WHERE
key_id = '906c546ff6028543cf670c689e8df489989f555c9e40f12660000d32ebb9b4c3'
AND (
token = '6YyY0+ZPzKxnW+iDi+C9a67o4J9rhBpq+yCRVMIEFIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)