UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dnaSydSDV5CJw62lVDrDrBCmLL64WjFWPjMibijOL9k=' 
WHERE 
  key_id = '9f2bc4ca842563d49f0904d271078ef6b02f3208103b0478ba4f75b21917e657' 
  AND (
    token = 'dnaSydSDV5CJw62lVDrDrBCmLL64WjFWPjMibijOL9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029