UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '57Pv+QnoZHpX58sMRsjuxP7MDyAv3KLYMwPMYunHzAg='
WHERE
key_id = 'ea0c183bf270d303717998ca9747874fffef9daaea3832d59f589da572d028a7'
AND (
token = '57Pv+QnoZHpX58sMRsjuxP7MDyAv3KLYMwPMYunHzAg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)