UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1rKHk7Cy4yblTxbjVaisTLvDdio2S4P1PbhZrP7T7X4=' 
WHERE 
  key_id = '23d4b87ad20db206444ec8dcf2b6bc45a8405d7e8540bfef059ddc5e96b0fea9' 
  AND (
    token = '1rKHk7Cy4yblTxbjVaisTLvDdio2S4P1PbhZrP7T7X4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041