UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2BB0i1dFXBjBsrzeFHp5yEah/ULjGJ0mTUmIzjZaUcA=' 
WHERE 
  key_id = 'fb76ba95fb4bfde7bfc8757866c9b066ae42d2b43aa95c11958746c24680ce0f' 
  AND (
    token = '2BB0i1dFXBjBsrzeFHp5yEah/ULjGJ0mTUmIzjZaUcA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027