UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8roaEBSwZ5NTdgEJGoGcTm1EdXrp6m7Gq/vqAZtBk44='
WHERE
key_id = 'e5bfaf5d3fd9d319d3df33331f6b89b4259a839ec62e1c14cbb9410f599ed9e0'
AND (
token = '8roaEBSwZ5NTdgEJGoGcTm1EdXrp6m7Gq/vqAZtBk44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)