UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iu6EjA7GEqK19iWOBRvBxsNv+KvKvCCEEP5+/jOWIJA='
WHERE
key_id = '1221993cf1322acddffc1ce4760b165953dc089cbff747ee596a4fd3e599ed75'
AND (
token = 'iu6EjA7GEqK19iWOBRvBxsNv+KvKvCCEEP5+/jOWIJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)