UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hzJlclR2tnuTGiSJAM0x4kkTqckP/5+ebmY6fkgkcBk=' 
WHERE 
  key_id = '6e6360395c6d4aa009a96c6d777bc06363f28c7bc256e41e2553c62f02489096' 
  AND (
    token = 'hzJlclR2tnuTGiSJAM0x4kkTqckP/5+ebmY6fkgkcBk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035