UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6IJocPwAY6Z/iKyje/NQkAGnVKMitPJz9Fk4qm6qpSM=' 
WHERE 
  key_id = 'eba27408b83f4cde4b9c1e77ba60500d9c5368149664a23a005709d93d7f7e06' 
  AND (
    token = '6IJocPwAY6Z/iKyje/NQkAGnVKMitPJz9Fk4qm6qpSM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053