UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Esws6NPMdxEnDvyHJqCQ7nL4OIXNEQimEb4uf3wh7Pg='
WHERE
key_id = '56ef25bbcd9d307c57da60b9ada940756900886212c75697308a4fe829843da2'
AND (
token = 'Esws6NPMdxEnDvyHJqCQ7nL4OIXNEQimEb4uf3wh7Pg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)