UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fMyOZ32X5QJmXreDXKp06VWruS4mlnNrlCNDtyZa7yQ='
WHERE
key_id = '2525590d8bdb7fd72f63ce834e7b92b5454315ae8bef39229e4ae3e7025d1191'
AND (
token = 'fMyOZ32X5QJmXreDXKp06VWruS4mlnNrlCNDtyZa7yQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)