UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GEQBKtxnp4qn/fYmL2/3nmBX3vrY3FMCW7JXfvtdD9U='
WHERE
key_id = 'b2ef1617030eaf256ab72d3d91c9aa32073a6d360719f0a314479abe88f217e0'
AND (
token = 'GEQBKtxnp4qn/fYmL2/3nmBX3vrY3FMCW7JXfvtdD9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)