UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SqLmUNTwcKwG1to9AsdsRtv1egJgI21WCH3v9No/BCo=' 
WHERE 
  key_id = 'ae354d88dc0909269a86e04adce9b5faf6b053c7241c6cf830c5b8af78eb765e' 
  AND (
    token = 'SqLmUNTwcKwG1to9AsdsRtv1egJgI21WCH3v9No/BCo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042