UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wOh6uJ15mp03cBwJQ7FPa9Ct0h6F2EIdzFOTjoESHWM='
WHERE
key_id = '9a9075db3654b26fa2ee9cb0fa0a0853fe0a8140ed52fc6553cda96d28dd1c49'
AND (
token = 'wOh6uJ15mp03cBwJQ7FPa9Ct0h6F2EIdzFOTjoESHWM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)