UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8IbKtLltQ4b1x/NAOW6dP1TXFzZaUbx3QnSB3jJASys=' 
WHERE 
  key_id = '28c7b54b643ed1255919e445a4f3ad57a2aecb91f5f228bfe720a203ef173106' 
  AND (
    token = '8IbKtLltQ4b1x/NAOW6dP1TXFzZaUbx3QnSB3jJASys=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028