UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nl6FSjgeGFMyleB86Fb2EwhGuGXWDvByn5Etf42W7jY=' 
WHERE 
  key_id = '6e07a5675a637d84e7f532fd1dbe5bd88d2896d88ffd08c9134706d8456a166b' 
  AND (
    token = 'Nl6FSjgeGFMyleB86Fb2EwhGuGXWDvByn5Etf42W7jY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033