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