UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EaooKkC/6fNOlSwgexOWsN0XvuS0PwN+tC3BIFB/2BE='
WHERE
key_id = '0e433f6a5e8eb503527e2a1a58506e25e929665add7e4ac7282cb37dcc3cc6e2'
AND (
token = 'EaooKkC/6fNOlSwgexOWsN0XvuS0PwN+tC3BIFB/2BE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)