UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IYkvhuI30syeKsJlo3xSi2kGYSD30lDZh1L2cR6Vsgg='
WHERE
key_id = 'de15fb40961ff740c5c69ef622a75146c7eea95d59d8b9a1b4cbe4dd9153997f'
AND (
token = 'IYkvhuI30syeKsJlo3xSi2kGYSD30lDZh1L2cR6Vsgg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)