UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xtYVkABZbMBlzTdBrVDog5/X5CUX6uoAt91PPBKlDk8=' 
WHERE 
  key_id = 'bc3915326a257a6b9ffeb3035bb59d57575eadde9ba1ddac6e844236a2dbf71a' 
  AND (
    token = 'xtYVkABZbMBlzTdBrVDog5/X5CUX6uoAt91PPBKlDk8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028