UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g/cPAueqor7IYXY1rn6haoWngqr/JhQhtnJx1G2vDkM=' 
WHERE 
  key_id = 'a00c069cff0f5987194ba57ae176d6c268b70c626c6186ebca953a6f4645fde0' 
  AND (
    token = 'g/cPAueqor7IYXY1rn6haoWngqr/JhQhtnJx1G2vDkM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028