UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ujKXNJo/L2qgTNjS6wBcHM4QuwcxOnWexrq9DXfdUo0='
WHERE
key_id = '0ed9f997673c75b9741069aecc2f11ac53377597cba7030bf8d7d46387178ccb'
AND (
token = 'ujKXNJo/L2qgTNjS6wBcHM4QuwcxOnWexrq9DXfdUo0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)