UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qNkU2Au26Lw0GME49uignw6v5QNf4ciTvJYIixrCz8w=' 
WHERE 
  key_id = '01dbe401ec4416003078e7b6e81d1795bd7ce6c1718f87e33f7288ff88884560' 
  AND (
    token = 'qNkU2Au26Lw0GME49uignw6v5QNf4ciTvJYIixrCz8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028