UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CW4NnrJ+iL0BIvqOig4NPrpKRbhRL0Bqfie4qUiifZU=' 
WHERE 
  key_id = 'fb0967e5c6ff95ac34025b579a12dace696bfbe1e2d0865eed8ee4e858533992' 
  AND (
    token = 'CW4NnrJ+iL0BIvqOig4NPrpKRbhRL0Bqfie4qUiifZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037