UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2IH6FyMOT4fq5DIAZU9HrlpdHXK7GGM+/exelWDNQYQ=' 
WHERE 
  key_id = '54dc8f6fddc35f80fc243a61a72ba01287bb54f477bccb988d392a6e749ee2ed' 
  AND (
    token = '2IH6FyMOT4fq5DIAZU9HrlpdHXK7GGM+/exelWDNQYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026