UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6mRxXo3GFKYAiY1oMmMFJJuuOsc8H3/T6+xLzIS8ySU='
WHERE
key_id = 'bbce0f52a3fb589dc76831873cb669f45177430a3dfb2bcd31a2fa182ffd9744'
AND (
token = '6mRxXo3GFKYAiY1oMmMFJJuuOsc8H3/T6+xLzIS8ySU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)